var e = require("../../utils/util.js");

getApp();

Page({
    data: {
        lotto: null,
        ruleShow: !0
    },
    onLoad: function(t) {
        var a = e.getStorage("lotto_preview"), r = e.getStorage("userInfo"), n = {
            imgUrls: [ "https://cdn-xcxcustom.weiyoubot.cn/20180116/392dffeee3c320a1ab8e5a15d743522a.jpg" ],
            indicatorDots: !1,
            autoplay: !0,
            interval: 5e3,
            duration: 1e3
        };
        a.banners.length > 1 && (n.indicatorDots = !0), a.banners.length && (n.imgUrls = a.banners);
        var i = {
            owner_name: a.signName ? a.signName : r.nickName,
            owner_pic: r.avatarUrl,
            prizes: a.prizes,
            title: a.title,
            content: a.rule,
            type: parseInt(a.typeIndex),
            date: a.date + " " + a.time,
            limit: parseInt(a.joinNum),
            phone: a.phone ? a.phone : e.getStorage("userInfo").phone
        };
        this.setData({
            lotto: i,
            swiper: n
        });
    },
    onShow: function() {},
    showPic: function(e) {
        var t = e.currentTarget.dataset.type, a = e.currentTarget.dataset.url, r = [ a ];
        2 == t && (r = this.data.swiper.imgUrls), wx.previewImage({
            current: a,
            urls: r
        });
    },
    ruleDetail: function(e) {
        "show" == e.currentTarget.dataset.opt ? this.setData({
            ruleShow: !0
        }) : this.setData({
            ruleShow: !1
        });
    },
    exitPreview: function() {
        wx.navigateBack({
            delta: -1
        });
    }
});